
<%@page import="modelo.io.ManejadorArchivos"%>
<%@page import="modelo.dominio.Pago"%>
<%@page import="java.util.List"%>
<br/> <%
    List<Pago> pagos = (List<Pago>) request.getAttribute("pagos");%>
<div id="pnl_resumen_pago">
    <p>
        <strong>Folio Internet: </strong><%=request.getAttribute("folioInternet")%>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <strong>TOTAL: </strong>$ <%=pagos.get(0).getPainTotal()%>
    </p>
    <div id='pnl_listado' class="wscroll">
        <table border='0' cellpadding='4' cellspacing='0'>
            <thead>
                <tr class='encabezado'>
                    <th>Cliente</th>
                    <th>Tipo Doc.</th>
                    <th>Documento</th>
                    <th>Total Pagar</th>
                    <th>Fecha</th>
                </tr>
            </thead>
            <tbody> <%
                for (int i = 0; i < pagos.size(); i++) {%>
                <tr>
                    <td><%=pagos.get(i).getCliente()%></td>
                    <td align="center"><%=pagos.get(i).getTipoDoc()%></td>
                    <td><%=pagos.get(i).getSerieNumero()%></td>
                    <td align="right">$ <%=pagos.get(i).getTotal()%></td>
                    <td align="center"><%=pagos.get(i).getFecha()%></td>
                </tr>
                <% }%>
            </tbody>
        </table>
    </div> 
</div> <%
    String s_transm      = request.getAttribute("s_transm").toString();//"00005000010000500002";
    String c_referencia  = request.getAttribute("c_referencia").toString();//"00005000010000500002";
    String urlMultiPagos = "";
    try {
        urlMultiPagos = ManejadorArchivos.instancia().obtenerPropiedad("../conf.properties", "url_multipagos");
    } catch (Exception ex) {
        urlMultiPagos = "#";
        out.println("No fue posible obtener la url de Multipagos");
    }
    String t_importe = request.getAttribute("t_importe").toString();
    String val_1 = request.getAttribute("val_1").toString();
    String val_2 = request.getAttribute("val_2").toString();
    String val_13 = request.getAttribute("val_13").toString();
    String txt_user = request.getAttribute("txt_user").toString();
    String txt_cia = request.getAttribute("txt_cia").toString();%>
<form id='frm_pagar' name='frm_pagar' action='<%=urlMultiPagos%>' method='post'>
    <input type='hidden' name='s_transm' value='<%=s_transm%>'>
    <input type='hidden' name='c_referencia' value='<%=c_referencia%>'>
    <input type='hidden' name='t_importe' value='<%=t_importe%>'>
    <input type='hidden' name='val_1' value='<%=val_1%>'>
    <input type='hidden' name='val_2' value='<%=val_2%>'>
    <input type="hidden" name="t_servicio" value="99">
    <input type="hidden" name="val_3" value='1'> <!-- moneda -->
    <input type="hidden" name="val_4" value="1"> <!-- idioma -->
    <input type="hidden" name="val_5" value="1"> <!-- financiar -->
    <input type="hidden" name="val_6" value=""> <!-- Sin financiamiento-->
    <input type="hidden" name="val_13" value="<%=val_13%>">
    <input type="hidden" name="txt_user" value="<%=txt_user%>">
    <input type="hidden" name="txt_cia" value="<%=txt_cia%>">
    <input type="button" value="Imprimir" class="button small green" onclick="imprimir('#pnl_resumen_pago');"/>
    <input type='submit' value='Pagar' class="button small blue">
</form> 
<script type="text/javascript">
        function imprimir(id_div) {
            var printW = window.open(' ', 'popimpr');
            printW.document.write('<html><head><title>Resumen del pago</title>');
            printW.document.write('</head><body>');
            printW.document.write('<h2>Detalle del pago</h2>');
            printW.document.write('<img src="http://www.cmoctezuma.com.mx/images/logo-moctezuma-cementos-concretos.png" width="250" height="50" alt="Logo">');
            printW.document.write('<br/><br/>');
            printW.document.write($(id_div).html());
            printW.document.write('</body></html>');
            printW.document.close();
            printW.print();
            printW.close();
            return true;
        }
</script>
